<?php

use Illuminate\Support\Facades\Route;
use App\Http\Admin\Controllers\AdminUserController;

Route::group(['prefix' => 'user'], function () {
    Route::post('login', [AdminUserController::class, "login"])->name('login');

    // 登录校验
    Route::middleware(['auth:sanctum', 'abilities:admin'])->group(function () {

        Route::get('logout', [AdminUserController::class, "logout"]);
        Route::get('info/self', [AdminUserController::class, "infoSelf"]);
        Route::get('perm/menus', [AdminUserController::class, "userPermMenus"]);
        Route::get('perms', [AdminUserController::class, "userPerms"]);
        Route::put('update/self', [AdminUserController::class, "updateSelf"]);

        // 用户管理
        Route::post('add', [AdminUserController::class, "add"]);
        Route::put('update', [AdminUserController::class, "update"]);
        Route::get('list', [AdminUserController::class, "list"]);
        Route::get('info', [AdminUserController::class, "info"]);

    });
});
